<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets" template="/protected/template/template.xhtml">
	<ui:define name="content">
		<p:panel header="Tag Management">
			<p:messages />
			<p:panelGrid>
				<p:row>
					<p:column>
						<p:outputLabel value="Name" for="name" />
					</p:column>
					<p:column>
						<p:inputText id="name" value="#{tagManagementBean.tag.name}" required="true" />
					</p:column>
				</p:row>
				<p:row>
					<p:column>
						<p:outputLabel value="Description" for="description" />
					</p:column>
					<p:column>
						<p:inputTextarea id="description" value="#{tagManagementBean.tag.description}" />
					</p:column>
				</p:row>
				<p:row rendered="#{tagManagementBean.clientRendered}">
					<p:column>
						<p:outputLabel value="Client" for="client" />
					</p:column>
					<p:column>
						<p:selectOneMenu id="client" value="#{tagManagementBean.tag.client}" converter="genericEntityConverter" required="true">
							<f:selectItem itemValue="" itemLabel="" />
							<f:selectItems value="#{tagManagementBean.clients}" var="client" itemValue="#{client}" itemLabel="#{client.name}" />
							<p:ajax update="logSources" listener="#{tagManagementBean.handleClientChange}" />
						</p:selectOneMenu>
					</p:column>
				</p:row>
				<p:row>
					<p:column>
						<p:outputLabel value="Log Sources" for="logSources" />
					</p:column>
					<p:column>
						<p:pickList id="logSources" value="#{tagManagementBean.logSources}" var="logSource" itemValue="#{logSource}" itemLabel="#{logSource.name}" converter="genericEntityConverter" required="true">
							<f:facet name="sourceCaption">
								<h:outputText value="Available" />
							</f:facet>
							<f:facet name="targetCaption">
								<h:outputText value="Selected" />
							</f:facet>
						</p:pickList>
					</p:column>
				</p:row>
				<p:row>
					<p:column>
						<p:commandButton value="Save" action="#{tagManagementBean.save}" ajax="false" />
					</p:column>
				</p:row>
			</p:panelGrid>
		</p:panel>
	</ui:define>
</ui:composition>
